/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    ap-northeast-2-pop = 'mts.aliyuncs.com',
    ap-southeast-2 = 'mts.aliyuncs.com',
    ap-southeast-3 = 'mts.aliyuncs.com',
    cn-beijing-finance-1 = 'mts.aliyuncs.com',
    cn-beijing-finance-pop = 'mts.aliyuncs.com',
    cn-beijing-gov-1 = 'mts.aliyuncs.com',
    cn-beijing-nu16-b01 = 'mts.aliyuncs.com',
    cn-chengdu = 'mts.aliyuncs.com',
    cn-edge-1 = 'mts.aliyuncs.com',
    cn-fujian = 'mts.aliyuncs.com',
    cn-haidian-cm12-c01 = 'mts.aliyuncs.com',
    cn-hangzhou-bj-b01 = 'mts.aliyuncs.com',
    cn-hangzhou-finance = 'mts.aliyuncs.com',
    cn-hangzhou-internal-prod-1 = 'mts.aliyuncs.com',
    cn-hangzhou-internal-test-1 = 'mts.aliyuncs.com',
    cn-hangzhou-internal-test-2 = 'mts.aliyuncs.com',
    cn-hangzhou-internal-test-3 = 'mts.aliyuncs.com',
    cn-hangzhou-test-306 = 'mts.aliyuncs.com',
    cn-hongkong-finance-pop = 'mts.aliyuncs.com',
    cn-huhehaote-nebula-1 = 'mts.aliyuncs.com',
    cn-north-2-gov-1 = 'mts.aliyuncs.com',
    cn-qingdao-nebula = 'mts.aliyuncs.com',
    cn-shanghai-et15-b01 = 'mts.aliyuncs.com',
    cn-shanghai-et2-b01 = 'mts.aliyuncs.com',
    cn-shanghai-finance-1 = 'mts.aliyuncs.com',
    cn-shanghai-inner = 'mts.aliyuncs.com',
    cn-shanghai-internal-test-1 = 'mts.aliyuncs.com',
    cn-shenzhen-finance-1 = 'mts.aliyuncs.com',
    cn-shenzhen-inner = 'mts.aliyuncs.com',
    cn-shenzhen-st4-d01 = 'mts.aliyuncs.com',
    cn-shenzhen-su18-b01 = 'mts.aliyuncs.com',
    cn-wuhan = 'mts.aliyuncs.com',
    cn-wulanchabu = 'mts.aliyuncs.com',
    cn-yushanfang = 'mts.aliyuncs.com',
    cn-zhangbei = 'mts.aliyuncs.com',
    cn-zhangbei-na61-b01 = 'mts.aliyuncs.com',
    cn-zhangjiakou-na62-a01 = 'mts.aliyuncs.com',
    cn-zhengzhou-nebula-1 = 'mts.aliyuncs.com',
    eu-west-1-oxs = 'mts.aliyuncs.com',
    me-east-1 = 'mts.aliyuncs.com',
    rus-west-1-pop = 'mts.aliyuncs.com',
    us-east-1 = 'mts.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('mts', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model QueryCopyrightRequest {
  createTimeEnd?: long(name='CreateTimeEnd', example='1627357322'),
  createTimeStart?: long(name='CreateTimeStart', example='1627357322'),
  jobId?: string(name='JobId', example='e44f30ce-21d9-4814-901d-7925f748****'),
  level?: long(name='Level', example='2'),
  pageNumber?: long(name='PageNumber', example='0'),
  pageSize?: long(name='PageSize', example='1'),
}

model QueryCopyrightResponseBody = {
  data?: [ 
    {
      callback?: string(name='Callback', example='http://example.com/callback'),
      gmtCreate?: long(name='GmtCreate', example='1627357322'),
      gmtModified?: long(name='GmtModified', example='1627357322'),
      input?: string(name='Input', example='{"Bucket":"abc-test","Location":"oss-cn-shanghai","Object":"test.mp4"}'),
      jobId?: string(name='JobId', example='bfb786c639894f4d80648792021e****'),
      level?: long(name='Level', example='2'),
      message?: string(name='Message', example='平头哥半导体(上海)'),
      messageId?: long(name='MessageId', example='82'),
      output?: string(name='Output', example='{"Bucket":"abc-test","Location":"oss-cn-shanghai","Object":"out.mp4"}'),
      result?: string(name='Result', example='{"Code":"success","Message":"ok"}'),
      status?: string(name='Status', example='Success'),
      userData?: string(name='UserData', example='{"uid":134669327666****}'),
      userId?: long(name='UserId', example='134669327666****'),
    }
  ](name='Data'),
  requestID?: string(name='RequestID', example='61038D1A424235AE267B9817'),
  statusCode?: long(name='StatusCode', example='200'),
}

model QueryCopyrightResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryCopyrightResponseBody(name='body'),
}

async function queryCopyrightWithOptions(request: QueryCopyrightRequest, headers: map[string]string, runtime: Util.RuntimeOptions): QueryCopyrightResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.createTimeEnd)) {
    body['CreateTimeEnd'] = request.createTimeEnd;
  }
  if (!Util.isUnset(request.createTimeStart)) {
    body['CreateTimeStart'] = request.createTimeStart;
  }
  if (!Util.isUnset(request.jobId)) {
    body['JobId'] = request.jobId;
  }
  if (!Util.isUnset(request.level)) {
    body['Level'] = request.level;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryCopyright',
    version = '2021-07-28',
    protocol = 'HTTPS',
    pathname = `/queryCopyrightJob`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryCopyright(request: QueryCopyrightRequest): QueryCopyrightResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return queryCopyrightWithOptions(request, headers, runtime);
}

model QueryCopyrightExtractRequest {
  jobId?: string(name='JobId', example='ebbfe90c63b54ed4b61acb2f6c44****'),
}

model QueryCopyrightExtractResponseBody = {
  data?: {
    message?: string(name='Message', example='example water mark'),
  }(name='Data'),
  message?: string(name='Message', example='ok'),
  requestID?: string(name='RequestID', example='54BB917F-DD35-4F32-BABA-E60E31B21W63'),
  statusCode?: long(name='StatusCode', example='200'),
}

model QueryCopyrightExtractResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryCopyrightExtractResponseBody(name='body'),
}

async function queryCopyrightExtractWithOptions(request: QueryCopyrightExtractRequest, headers: map[string]string, runtime: Util.RuntimeOptions): QueryCopyrightExtractResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.jobId)) {
    body['JobId'] = request.jobId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryCopyrightExtract',
    version = '2021-07-28',
    protocol = 'HTTPS',
    pathname = `/queryCopyrightExtract`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryCopyrightExtract(request: QueryCopyrightExtractRequest): QueryCopyrightExtractResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return queryCopyrightExtractWithOptions(request, headers, runtime);
}

model QueryTraceAbRequest {
  jobId?: string(name='JobId', example='a20f60d76ac9485496c4a1c6fa70****'),
  mediaId?: string(name='MediaId', example='437bd2b516ffda105d07b12a9a82****'),
}

model QueryTraceAbResponseBody = {
  data?: [ 
    {
      callback?: string(name='Callback', example='http://example.com/callback'),
      gmtCreate?: long(name='GmtCreate', example='1727441315'),
      gmtModified?: long(name='GmtModified', example='1727441315'),
      input?: string(name='Input', example='{"Bucket":"exampleBucket","Location":"oss-cn-shanghai","Object":"test.jpeg"}'),
      jobId?: string(name='JobId', example='bfb786c639894f4d80648792021e****'),
      level?: long(name='Level', example='2'),
      mediaId?: string(name='MediaId', example='437bd2b516ffda105d07b12a9a82****'),
      output?: string(name='Output', example='{"Bucket":"ivison-test","Location":"oss-cn-shanghai","Dir":"out/"}'),
      result?: string(name='Result', example='{"Code":"success","Message":"ok"}'),
      status?: string(name='Status', example='Success'),
      userData?: string(name='UserData', example='{"uid":134669327666****}'),
      userId?: long(name='UserId', example='134669327666****'),
    }
  ](name='Data'),
  message?: string(name='Message', example='ok'),
  requestID?: string(name='RequestID', example='61038D31354232E106FB****'),
  statusCode?: long(name='StatusCode', example='200'),
}

model QueryTraceAbResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryTraceAbResponseBody(name='body'),
}

async function queryTraceAbWithOptions(request: QueryTraceAbRequest, headers: map[string]string, runtime: Util.RuntimeOptions): QueryTraceAbResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.jobId)) {
    body['JobId'] = request.jobId;
  }
  if (!Util.isUnset(request.mediaId)) {
    body['MediaId'] = request.mediaId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryTraceAb',
    version = '2021-07-28',
    protocol = 'HTTPS',
    pathname = `/queryTraceAb`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryTraceAb(request: QueryTraceAbRequest): QueryTraceAbResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return queryTraceAbWithOptions(request, headers, runtime);
}

model QueryTraceExtractRequest {
  jobId?: string(name='JobId', example='ebbfe90c63b54ed4b61acb2f6c44****'),
}

model QueryTraceExtractResponseBody = {
  data?: {
    trace?: string(name='Trace', example='example water mark'),
  }(name='Data'),
  message?: string(name='Message', example='ok'),
  requestID?: string(name='RequestID', example='610399D2334334AE2CB70C28'),
  statusCode?: long(name='StatusCode', example='200'),
}

model QueryTraceExtractResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryTraceExtractResponseBody(name='body'),
}

async function queryTraceExtractWithOptions(request: QueryTraceExtractRequest, headers: map[string]string, runtime: Util.RuntimeOptions): QueryTraceExtractResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.jobId)) {
    body['JobId'] = request.jobId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryTraceExtract',
    version = '2021-07-28',
    protocol = 'HTTPS',
    pathname = `/queryTraceExtract`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryTraceExtract(request: QueryTraceExtractRequest): QueryTraceExtractResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return queryTraceExtractWithOptions(request, headers, runtime);
}

model QueryTraceMuRequest {
  createTimeEnd?: long(name='CreateTimeEnd', example='1527441300'),
  createTimeStart?: long(name='CreateTimeStart', example='1527441300'),
  jobId?: string(name='JobId', example='bfb786c639894f4d80648792021e****'),
  level?: long(name='Level', example='2'),
  messageId?: long(name='MessageId', example='78'),
  pageNumber?: long(name='PageNumber', example='0'),
  pageSize?: long(name='PageSize', example='5'),
}

model QueryTraceMuResponseBody = {
  data?: [ 
    {
      gmtCreate?: long(name='GmtCreate', example='1527441300'),
      gmtModified?: long(name='GmtModified', example='1527441300'),
      jobId?: string(name='JobId', example='bfb786c639894f4d80648792021e****'),
      mediaId?: string(name='MediaId', example='437bd2b516ffda105d07b12a9a82****'),
      output?: string(name='Output', example='{"Bucket":"ivison-test","Location":"oss-cn-shanghai","Object":"out/test.m3u8"}'),
      status?: string(name='Status', example='Success'),
      trace?: string(name='Trace', example='平头哥半导体'),
      traceId?: long(name='TraceId', example='65'),
      userData?: string(name='UserData', example='{"uid":134669327666****}'),
      userId?: long(name='UserId', example='1346693276669150'),
    }
  ](name='Data'),
  message?: string(name='Message', example='ok'),
  requestID?: string(name='RequestID', example='61038D2F324544B46C27783B'),
  statusCode?: long(name='StatusCode', example='200'),
}

model QueryTraceMuResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryTraceMuResponseBody(name='body'),
}

async function queryTraceMuWithOptions(request: QueryTraceMuRequest, headers: map[string]string, runtime: Util.RuntimeOptions): QueryTraceMuResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.createTimeEnd)) {
    body['CreateTimeEnd'] = request.createTimeEnd;
  }
  if (!Util.isUnset(request.createTimeStart)) {
    body['CreateTimeStart'] = request.createTimeStart;
  }
  if (!Util.isUnset(request.jobId)) {
    body['JobId'] = request.jobId;
  }
  if (!Util.isUnset(request.level)) {
    body['Level'] = request.level;
  }
  if (!Util.isUnset(request.messageId)) {
    body['MessageId'] = request.messageId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryTraceMu',
    version = '2021-07-28',
    protocol = 'HTTPS',
    pathname = `/queryTraceM3u8`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryTraceMu(request: QueryTraceMuRequest): QueryTraceMuResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return queryTraceMuWithOptions(request, headers, runtime);
}

model SubmitCopyrightExtractRequest {
  callBack?: string(name='CallBack', example='http://example.com/callback'),
  input?: string(name='Input', example='{"Bucket":"example","Location":"oss-cn-shanghai","Object":"example.mp4"}'),
  params?: string(name='Params', example='{"strength":"1"}'),
  url?: string(name='Url', example='http://example.com/test.mp4'),
  userData?: string(name='UserData', example='23test'),
}

model SubmitCopyrightExtractResponseBody = {
  data?: {
    jobId?: string(name='JobId', example='ebbfe90c63b54ed4b61acb2f6c44****'),
  }(name='Data'),
  message?: string(name='Message', example='ok'),
  requestID?: string(name='RequestID', example='610399D2334334AE2CB70C28'),
  statusCode?: long(name='StatusCode', example='200'),
}

model SubmitCopyrightExtractResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitCopyrightExtractResponseBody(name='body'),
}

async function submitCopyrightExtractWithOptions(request: SubmitCopyrightExtractRequest, headers: map[string]string, runtime: Util.RuntimeOptions): SubmitCopyrightExtractResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.callBack)) {
    body['CallBack'] = request.callBack;
  }
  if (!Util.isUnset(request.input)) {
    body['Input'] = request.input;
  }
  if (!Util.isUnset(request.params)) {
    body['Params'] = request.params;
  }
  if (!Util.isUnset(request.url)) {
    body['Url'] = request.url;
  }
  if (!Util.isUnset(request.userData)) {
    body['UserData'] = request.userData;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SubmitCopyrightExtract',
    version = '2021-07-28',
    protocol = 'HTTPS',
    pathname = `/submitCopyrightExtract`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitCopyrightExtract(request: SubmitCopyrightExtractRequest): SubmitCopyrightExtractResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return submitCopyrightExtractWithOptions(request, headers, runtime);
}

model SubmitCopyrightJobRequest {
  callBack?: string(name='CallBack', example='http://example.com/callback'),
  description?: string(name='Description', example='地址 : 上海市浦东新区上科路366号川和路55弄2号5层水印信息描述'),
  input?: string(name='Input', example='{"Bucket":"example-bucket","Location":"oss-cn-shanghai","Object":"example.flv"}'),
  level?: long(name='Level', example='2'),
  message?: string(name='Message', example='平头哥(上海)半导体技术有限公司水印信息'),
  output?: string(name='Output', example='{"Bucket":"example-bucket","Location":"oss-cn-shanghai","Object":"example.flv"}'),
  params?: string(name='Params', example='{"vsid":"198"}'),
  startTime?: long(name='StartTime', example='100'),
  totalTime?: long(name='TotalTime', example='1000'),
  url?: string(name='Url', example='http://www.example.com/video/test.mp4'),
  userData?: string(name='UserData', example='123'),
  visibleMessage?: string(name='VisibleMessage', example='abcd'),
}

model SubmitCopyrightJobResponseBody = {
  data?: {
    jobId?: string(name='JobId', example='bfb786c639894f4d80648792021e****'),
  }(name='Data'),
  message?: string(name='Message', example='ok'),
  requestID?: string(name='RequestID', example='610399D2334334AE2CB70C28'),
  statusCode?: long(name='StatusCode', example='200'),
}

model SubmitCopyrightJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitCopyrightJobResponseBody(name='body'),
}

async function submitCopyrightJobWithOptions(request: SubmitCopyrightJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): SubmitCopyrightJobResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.callBack)) {
    body['CallBack'] = request.callBack;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.input)) {
    body['Input'] = request.input;
  }
  if (!Util.isUnset(request.level)) {
    body['Level'] = request.level;
  }
  if (!Util.isUnset(request.message)) {
    body['Message'] = request.message;
  }
  if (!Util.isUnset(request.output)) {
    body['Output'] = request.output;
  }
  if (!Util.isUnset(request.params)) {
    body['Params'] = request.params;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.totalTime)) {
    body['TotalTime'] = request.totalTime;
  }
  if (!Util.isUnset(request.url)) {
    body['Url'] = request.url;
  }
  if (!Util.isUnset(request.userData)) {
    body['UserData'] = request.userData;
  }
  if (!Util.isUnset(request.visibleMessage)) {
    body['VisibleMessage'] = request.visibleMessage;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SubmitCopyrightJob',
    version = '2021-07-28',
    protocol = 'HTTPS',
    pathname = `/submitCopyrightJob`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitCopyrightJob(request: SubmitCopyrightJobRequest): SubmitCopyrightJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return submitCopyrightJobWithOptions(request, headers, runtime);
}

model SubmitImageCopyrightRequest {
  level?: long(name='Level', example='2'),
  message?: string(name='Message', example='平头哥半导体科技有限公司'),
  output?: string(name='Output', example='{"Bucket":"abc-test","Location":"oss-cn-shanghai","Object":"out.jpeg"}'),
  params?: string(name='Params', example='{"width":2999, "height":2999, "afa": 3, "type":1, "version":0}'),
}

model SubmitImageCopyrightResponseBody = {
  data?: {
    jobId?: string(name='JobId', example='bfb786c639894f4d80648792021e****'),
  }(name='Data'),
  message?: string(name='Message', example='ok'),
  requestID?: string(name='RequestID', example='61038671443432952925C670'),
  statusCode?: long(name='StatusCode', example='200'),
}

model SubmitImageCopyrightResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitImageCopyrightResponseBody(name='body'),
}

async function submitImageCopyrightWithOptions(request: SubmitImageCopyrightRequest, headers: map[string]string, runtime: Util.RuntimeOptions): SubmitImageCopyrightResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.level)) {
    body['Level'] = request.level;
  }
  if (!Util.isUnset(request.message)) {
    body['Message'] = request.message;
  }
  if (!Util.isUnset(request.output)) {
    body['Output'] = request.output;
  }
  if (!Util.isUnset(request.params)) {
    body['Params'] = request.params;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SubmitImageCopyright',
    version = '2021-07-28',
    protocol = 'HTTPS',
    pathname = `/submitImageCopyright`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitImageCopyright(request: SubmitImageCopyrightRequest): SubmitImageCopyrightResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return submitImageCopyrightWithOptions(request, headers, runtime);
}

model SubmitTraceAbRequest {
  callBack?: string(name='CallBack', example='http://example.com/callback'),
  cipherBase64ed?: string(name='CipherBase64ed', example='Qh6OdgIMcliQSI1fReOw****'),
  input?: string(name='Input', example='{"Bucket":"ivison-test","Location":"oss-cn-shanghai","Object":"test.mp4"}'),
  level?: long(name='Level', example='2'),
  output?: string(name='Output', example='{"Bucket":"ivison-test","Location":"oss-cn-shanghai","Dir":"out/"}'),
  startTime?: long(name='StartTime', example='0'),
  totalTime?: long(name='TotalTime', example='360'),
  url?: string(name='Url', example='http://example.com/image_01.jpg'),
  userData?: string(name='UserData', example='{uid:1765****}'),
}

model SubmitTraceAbResponseBody = {
  data?: {
    jobId?: string(name='JobId', example='bfb786c639894f4d80648792021e****'),
    mediaId?: string(name='MediaId', example='437bd2b516ffda105d07b12a9a82****'),
  }(name='Data'),
  message?: string(name='Message', example='ok'),
  requestID?: string(name='RequestID', example='610399D2334334AE2CB70C28'),
  statusCode?: long(name='StatusCode', example='200'),
}

model SubmitTraceAbResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitTraceAbResponseBody(name='body'),
}

async function submitTraceAbWithOptions(request: SubmitTraceAbRequest, headers: map[string]string, runtime: Util.RuntimeOptions): SubmitTraceAbResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.callBack)) {
    body['CallBack'] = request.callBack;
  }
  if (!Util.isUnset(request.cipherBase64ed)) {
    body['CipherBase64ed'] = request.cipherBase64ed;
  }
  if (!Util.isUnset(request.input)) {
    body['Input'] = request.input;
  }
  if (!Util.isUnset(request.level)) {
    body['Level'] = request.level;
  }
  if (!Util.isUnset(request.output)) {
    body['Output'] = request.output;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.totalTime)) {
    body['TotalTime'] = request.totalTime;
  }
  if (!Util.isUnset(request.url)) {
    body['Url'] = request.url;
  }
  if (!Util.isUnset(request.userData)) {
    body['UserData'] = request.userData;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SubmitTraceAb',
    version = '2021-07-28',
    protocol = 'HTTPS',
    pathname = `/submitTraceAb`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitTraceAb(request: SubmitTraceAbRequest): SubmitTraceAbResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return submitTraceAbWithOptions(request, headers, runtime);
}

model SubmitTraceExtractRequest {
  callBack?: string(name='CallBack', example='http://example.com/callback'),
  input?: string(name='Input', example='{"Bucket":"example","Location":"oss-cn-shanghai","Object":"example.mp4"}'),
  params?: string(name='Params'),
  url?: string(name='Url', example='http://example.com/test.mp4'),
  userData?: string(name='UserData', example='51test'),
}

model SubmitTraceExtractResponseBody = {
  data?: {
    jobId?: string(name='JobId', example='ebbfe90c63b54ed4b61acb2f6c44****'),
  }(name='Data'),
  message?: string(name='Message', example='ok'),
  requestID?: string(name='RequestID', example='610399D2334334AE2CB70C28'),
  statusCode?: long(name='StatusCode', example='200'),
}

model SubmitTraceExtractResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitTraceExtractResponseBody(name='body'),
}

async function submitTraceExtractWithOptions(request: SubmitTraceExtractRequest, headers: map[string]string, runtime: Util.RuntimeOptions): SubmitTraceExtractResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.callBack)) {
    body['CallBack'] = request.callBack;
  }
  if (!Util.isUnset(request.input)) {
    body['Input'] = request.input;
  }
  if (!Util.isUnset(request.params)) {
    body['Params'] = request.params;
  }
  if (!Util.isUnset(request.url)) {
    body['Url'] = request.url;
  }
  if (!Util.isUnset(request.userData)) {
    body['UserData'] = request.userData;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SubmitTraceExtract',
    version = '2021-07-28',
    protocol = 'HTTPS',
    pathname = `/submitTraceExtract`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitTraceExtract(request: SubmitTraceExtractRequest): SubmitTraceExtractResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return submitTraceExtractWithOptions(request, headers, runtime);
}

model SubmitTracemuRequest {
  keyUri?: string(name='KeyUri', example='https://cipher.abc.com'),
  mediaId?: string(name='MediaId', example='437bd2b516ffda105d07b12a9a82****'),
  output?: string(name='Output', example='{"Bucket":"exampleBucket","Location":"oss-cn-shanghai","Object":"out.m3u8"}'),
  params?: string(name='Params'),
  trace?: string(name='Trace', example='平头哥半导体科技有限公司'),
}

model SubmitTracemuResponseBody = {
  data?: {
    code?: string(name='Code', example='10011001110101010101****'),
    jobId?: string(name='JobId', example='bfb786c639894f4d80648792021e****'),
  }(name='Data'),
  message?: string(name='Message', example='ok'),
  requestID?: string(name='RequestID', example='610393F5324544B46C60****'),
  statusCode?: long(name='StatusCode', example='200'),
}

model SubmitTracemuResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitTracemuResponseBody(name='body'),
}

async function submitTracemuWithOptions(request: SubmitTracemuRequest, headers: map[string]string, runtime: Util.RuntimeOptions): SubmitTracemuResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.keyUri)) {
    body['KeyUri'] = request.keyUri;
  }
  if (!Util.isUnset(request.mediaId)) {
    body['MediaId'] = request.mediaId;
  }
  if (!Util.isUnset(request.output)) {
    body['Output'] = request.output;
  }
  if (!Util.isUnset(request.params)) {
    body['Params'] = request.params;
  }
  if (!Util.isUnset(request.trace)) {
    body['Trace'] = request.trace;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SubmitTracemu',
    version = '2021-07-28',
    protocol = 'HTTPS',
    pathname = `/submitTraceM3u8`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitTracemu(request: SubmitTracemuRequest): SubmitTracemuResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return submitTracemuWithOptions(request, headers, runtime);
}

